package com.muse.designpatterns.flyweight;

import com.google.common.collect.Maps;
import java.util.Map;

public class NucleicInfoClient {
    private Map<Integer,NucleicInfo> pool = Maps.newHashMap();
    public NucleicInfoClient() {
        NucleicInfo nucleicInfo;
        for (int i = 0; i < 10; i++) {
            nucleicInfo = new NucleicInfo(i,"北京第"+i+"核算医院网点");
            pool.put(nucleicInfo.getId(), nucleicInfo);
        }
    }
    public NucleicInfo getNucleicInfo(Integer id) {
        if (id==null||!pool.containsKey(id)) {
            return null;
        }
        return pool.get(id);
    }


}
